<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFeishuCallingCards extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feishu_calling_cards', function (Blueprint $table) {
            $table->id();
            $table->string('feishuId', 16)->comment('飞书用户主键');
            $table->string('name', 20)->default('')->comment('飞书姓名');
            $table->char('mobile', 20)->default('')->comment('手机号');
            $table->string('position', 20)->default('')->comment('职位');
            $table->unsignedTinyInteger('showPosition')->default(1)->comment('是否显示职位');
            $table->unsignedInteger('companyAddressId')->default(0)->comment('公司地址 id');
            $table->string('wechatId', 50)->default(0)->comment('微信号');
            $table->string('wechatQrcode', 120)->default('')->comment('微信小程序分享码');
            $table->string('avatar', 120)->default(0)->comment('一寸照');
            $table->string('wechatUrl', 120)->default(0)->comment('微信加好友图片 url');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->index(['feishuId'], 'feishuId');
            $table->comment = '夸父员工飞书加盟名片';

        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feishu_calling_cards');
    }
}
